package com.xayy.health.core.enums;

import lombok.Getter;

/**
 * 模型算法运行状态枚举
 *
 * @author houchengwei
 * createTime 2023/2/20
 * @version V1.0
 */
public enum ModelTrainStatusEnum {
    //运行中
    RUNNING(1, "运行中"),
    //训练完成
    DONE(2, "训练完成"),
    //训练出错
    ABNORMAL(3, "训练出错");

    @Getter
    private Integer code;

    @Getter
    private String name;

    ModelTrainStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String valueof(Integer index) {
        for (ModelTrainStatusEnum relationTypeEnum : values()) {
            if (relationTypeEnum.getCode().equals(index)) {
                return relationTypeEnum.name;
            }
        }
        return "";
    }
}
